﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChurchDiary.TableEntity
{
    [Table("CH_OrganizationInfo")]
    public class EntityOrganizationInfo
    {
        [Key]
        public Guid OrganizationId { get; set; }
        public string NameOfOrganization { get; set; }
        public string OrganizationAbbrivation { get; set; }
        public string OrganizationAddress { get; set; }
        public string OrganizationLogo { get; set; }
        public string OrganizationEmail { get; set; }
        public string OrganizationPhone { get; set; }
        public string OrganizationMobile { get; set; }
        public string OrganizationWebsite { get; set; }
    }
    [Table("CH_Subcription")]
    public class EntitySubcription
    {
        [Key]
        public Guid SubcriptionId { get; set; }
        public string SubcriptionName { get; set; }
        public int SubcriptionDays { get; set; }
        public bool IsFree { get; set; }
        public bool IsActive { get; set; }
    }
    
    [Table("CH_DateFormate")]
    public class EntityDateFormate
    {
        [Key]
        public Guid DateFormateId { get; set; }
        public string DateFormateName { get; set; }
        public string DateFormates { get; set; }
    }
    [Table("CH_OrganizationType")]
    public class EntityOrganizationType
    {
        [Key]
        public Guid OrganizationTypeId { get; set; }
        public string OrganizationTypeName { get; set; }
    }
    [Table("CH_SignUps")]
    public class EntitySignUp
    {
        [Key]
        public Guid SignUpId { get; set; }
        public Guid OrganizationId { get; set; }
        public string FirstName { get; set; }
        public string MiddleName { get; set; }
        public string LastName { get; set; }
        public string EmailAddress { get; set; }
        public string PhoneNumber { get; set; }
        public string UserName { get; set; }
        public string Password { get; set; }
        public DateTime CreatedDate { get; set; }
        public bool IsEmailVerfied { get; set; }
    }
    [Table("CH_MailSettings")]
    public class EntityMailSettings
    {
        [Key]
        public Guid MailSettingsId { get; set; }
        public Guid OrganizationId { get; set; }
        public string EmailFrom { get; set; }
    }
    [Table("CH_Softwaresettings")]
    public class EntitySoftwareSettings
    {
        [Key]
        public Guid SoftwareSettings { get; set; }
        public Guid OrganizationId { get; set; }
        public bool EmailSettingsStatus { get; set; }
    }
    [Table("CH_OrganizationPartition")]
    public class EnitityOrganizationPartition
    {
        [Key]
        public Guid PartitionId { get; set; }
        [Required]
        public string PartitionName { get; set; }
        public string PartitionAbrivation { get; set; }
        [Required]
        public int OrganizationId { get; set; }
        [Required]
        public int OrganizationLevel { get; set; }
        [Required]
        public Guid ParentPartitionId { get; set; }
        public Guid? CreatedBy { get; set; }
        public DateTime? CreatedOn { get; set; }
        public DateTime? UpdatedOn { get; set; }
        public Guid? Updatedby { get; set; }
        [Required]
        public int Status { get; set; }

        [NotMapped]
        public EntityOrg Org { get; set; }
    }
    [Table("CH_EmailTemplate")]
    public class EntityEmailTemplate
    {
        [Key]
        public Guid EmailTemplateId { get; set; }
        public string TemplateType { get; set; }
        public string TemplateContent { get; set; }
        public string TemplateSubject { get; set; }
        public Guid? CreatedBy { get; set; }
        public DateTime? CreatedOn { get; set; }
        public Guid? UpdatedBy { get; set; }
        public DateTime? UpdatedOn { get; set; }
    }
    [Table("CH_SoftwareInfo")]
    public class EntitySoftwareInfo
    {
        [Key]
        public Guid SoftwareId { get; set; }
        public string SoftwareName { get; set; }
        public string SoftwareLogo { get; set; }
        public string SoftwareSupportLink { get; set; }
        public string SoftwareVersion { get; set; }
    }
    [Table("CH_Jobtitle")]
    public class EntityJobtitle
    {
        [Key]
        public Guid JobTitleId { get; set; }
        [Required]
        public string JobTitleName { get; set; }
        [Required]
        public int Organizationid { get; set; }
        [Required]
        public int Status { get; set; }
        /// <summary>
        /// True :- Can Have Multiple Persons
        /// False :- Can have only one member
        /// </summary>
        [DefaultValue(false)]
        public bool CanHaveMultiple { get; set; }

        [NotMapped]
        public string OrganizationName { get; set; }
        [NotMapped]
        public int TotalRecords { get; set; }
    }
    public class EntityOrg
    {
        public string OrganizationName { get; set; }
        public string ParentPartition { get; set; }
    }
    public class OrganizationLabels
    {
        [Display(Name="Partition Name")]
        public string OrganizationPartitionName { get; set; }
        [Display(Name = "Parent Organization")]
        public string ParentOrganization { get; set; }
        [Display(Name = "Organization Abrivation")]
        public string PartitionAbrivation { get; set; }
        [Display(Name = "Organization Name")]
        public string OrganizationType { get; set; }
        public string Action { get; set; }
    }
    public class EntityOrganizationProfile
    {
        public int id { get; set; }
        public int Organiztionid { get; set; }
        public string OrganizationName { get; set; }
        public string OrganizationAbrivation { get; set; }
        public int ParentOrganization { get; set; }
        public bool IsActive { get; set; }
        public bool IsMain { get; set; }
    }
    public class AllDepartMentDetails
    {
        public List<EntityOrganizationProfile> OrganizationProfile { get; set; }
        public List<EnitityOrganizationPartition> OrganizationPartition { get; set; }
    }
    public class InsertPartition
    {
        public string Partitionid { get; set; }
        public string PartitionAbrivation { get; set; }
        public string ParentOrganization { get; set; }
        public string PartitionLevel { get; set; }
        public int OrganizationId { get; set; }
        public string PartitionName { get; set; }
        public DateTime? createdOn { get; set; }
        public DateTime? UpdatedOn { get; set; }
    }
    public class OrganizationStructure
    {
        public int ParentKey { get; set; }
        public string DepartmentHead { get; set; }
        public List<OrganizationDetails> OrganizationTitle { get; set; }
        public string FullName { get { return string.Format("{0} {1}", DepartmentHead, OrganizationTitle); } }
    }
    public class OrganizationDetails
    {
        public int key { get; set; }
        public string name { get; set; }
        public string title { get; set; }
        public int? parent { get; set; }
    }
    public class Departments
    {
        public int Departmentsid { get; set; }
        public string DepartmentName { get; set; }
    }
}
